<script src="<?php echo base_url();?>/template/js/jquery.infieldlabel.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
	$(document).ready(function(){
		
        $("ul#chpk li").click(function(){
			var $idch = $(this).attr("id");
            $("ul#chpk li").removeClass();
            $(this).addClass('active');
            $.ajax({
                url: "<?php echo base_url();?>/mod_phongkham/mod_phongkham/hoidap",
                type: "POST",
                data:"idch="+$idch,
                success: function(data){
                    $("#introch").html(data);
                }
            }); 
		});
	   $('#sm').click(function() {
            var name = $("#name").val();
            var email = $("#email").val();
            var phone = $("#phone").val();
            var address = $("#address").val();
            var comment = $("#comment").val();
            var captcha = $("#captcha").val();
            
            $.ajax({
                url: "<?php echo base_url();?>/mod_phongkham/mod_phongkham/xulyform",
                type: "POST",
                cache: false,
                data: "captcha="+captcha+"&name="+name+"&email="+email+"&phone="+phone+"&address="+address+"&comment="+comment,
                success: function(html){
                    $(".error").html(html);
                }
            });
            $.ajax({
                url: "<?php echo base_url();?>/mod_phongkham/mod_phongkham/captchacm",
                type: "POST",
                cache: false,
                data: "load=return",
                success: function(html){
                    $(".cp").html(html);
                }
            });
            return false;
        });
        $(function(){ $("label").inFieldLabels(); });
    });
        
</script>

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=vi"></script>
<script type="text/javascript">
var map;
function initialize() {
    var myLatlng = new google.maps.LatLng(<?php echo $phongkham->map ?>);
    var myOptions = {
        zoom: 16,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    map = new google.maps.Map(document.getElementById("bandopk"), myOptions); 
    // Biến text chứa nội dung sẽ được hiển thị
    var text;
    text=   "<div class='bdtext'><?php echo $phongkham->title; ?></div><br />" + 
            "<div class='bdimage'><img src='<?php echo base_url().$phongkham->logo; ?>'  /></div>";
    var infowindow = new google.maps.InfoWindow({
        content: text,
        size: new google.maps.Size(100,50),
        position: myLatlng
    });
    infowindow.open(map);    
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
        title:"<?php echo $phongkham->title; ?>"
    });
}
</script>


<div id="mod_phongkham">
	<div class="module-title">
        <h3 class="title-phongkham"><?php echo $phongkham->title ?></h3>
	</div>
	<div class="module-content">
    <div class="module-content-inner clear">
        <div class="fLeft">
            <div class="thongtin">
                <ul>
                    <?php 
                    $add = !empty($phongkham->address)?$phongkham->address:'';
                    $ema = !empty($phongkham->email)?$phongkham->email:'';
                    $web = !empty($phongkham->website)?$phongkham->website:'';
                    $hit = !empty($phongkham->hits)?$phongkham->hits:'';
                    $like = !empty($like)?$like:'';
                    
                        echo '<li class="address">Địa chỉ: '.$add.'</li>';
                    if (!empty($phongkham->phone) && !empty($phongkham->fax))
                        echo '<li class="phone"><p style="margin: 0;">Điện thoại: '.$phongkham->phone.'&nbsp;&nbsp;&nbsp;Fax: '.$phongkham->fax.'</p></li>';
                    else if (!empty($phongkham->phone))
                        echo '<li class="phone"><p style="margin: 0;">Điện thoại: '.$phongkham->phone.'</p></li>';
                    else if (!empty($phongkham->fax))
                        echo '<li class="phone"><p style="margin: 0;">Điện thoại: '.$phongkham->fax.'</p></li>';
                    else {}
                    
                        echo '<li class="email">Email: '.$ema.'</li>';
                        echo '<li class="website">Website: '.$web.'</li>';
                        echo '<li class="hit">Lượt xem: '.$hit.'</li>';
                        echo '<li class="like">Thích: '.$like .'</li>';
                    ?>

                </ul>
            </div>
            <div class="menupk">
                <ul>
                    <li class="gt pk <?php echo $pkpage=='gt'?'active':null; ?>"><a href="<?php echo base_url().'phong-kham/'.$phongkham->alias.'-gt.html'; ?>" title="giới thiệu" >Giới thiệu</a></li>
                    <li class="hd pk <?php echo $pkpage=='hd'?'active':null; ?>"><a href="<?php echo base_url().'phong-kham/'.$phongkham->alias.'-hd.html'; ?>" title="hỏi đáp" >Hỏi đáp</a></li>
                </ul>
            </div>
        </div>
        <div class="fRight">
            <div class="videopk">
               <object width="258" height="240"><param name="movie" value="<?php echo 'http://www.youtube.com/v/'.$phongkham->video; ?>?version=3&amp;hl=vi_VN"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="<?php echo 'http://www.youtube.com/v/'.$phongkham->video; ?>?version=3&amp;hl=vi_VN" type="application/x-shockwave-flash" width="258" height="240" allowscriptaccess="always" wmode="transparent" allowfullscreen="true"></embed></object>
            </div>
        </div>
        <?php if($pkpage == 'gt'):?>
        <div id= "pkgioithieu" class="tabpkContents <?php echo $pkpage=='gt'?'active':null; ?>">
            <div class="pkinner">
                <?php echo $phongkham->fulltext ?>
                 <div class="bando">
                 <script type="text/javascript">
                	$(document).ready(function(){
                        initialize();
                	});
                    
                </script>
                    <div class="title"> Bản Đồ </div>
                    <div id="bandopk" style="height:400px; width:660px">&nbsp;</div>
                </div>
            </div>
           
            
        </div>
        <?php endif; if($pkpage == 'hd'): ?>
        <div id= "pkhoidap" class="tabpkContents <?php echo $pkpage=='hd'?'active':null; ?>">
            <div class="pkinner">
             <?php if(!empty($cauhoi)):?>
                <div class="cauhoipk fLeft" style="width: 332px;">
                    <div class="title">
                        <h3>Những câu hỏi được gửi cho phòng khám</h3>
                    </div>
                    <div class="content">
                        <ul id="chpk">
                           <?php 
                           $i = 0;
                           
                           foreach($cauhoi as $cauhoi1){
                            $class = ($i==0)?"active":"";
                            echo '<li id="'.$cauhoi1->id.'" class="'.$class.'"><p>'.$cauhoi1->introtext.'</p></li>';
                            $i++;
                           }
                               
                           ?>
                        </ul>
                    </div>
                    <div class="bottom">
                         <p style="font-weight:bold; color: #00f">phan trang</p>
                    </div>
                </div>
            <?php endif;?>
                <div class="cauhoipk fRight" style="width:<?php echo empty($cauhoi)?'678px':'332px';?>;">
                    <div class="title">
                        <h3>Form đăng nhập</h3>
                    </div>
                    <div class="content">
                        <p>Đây là form đăng nhập nếu chưa đăng nhập</p>
                        <p>Nếu đăng nhập rồi thì là form gửi câu hỏi</p>
                    </div>
                </div>
                <div id="introch">
                    <?php echo $introch; ?>
                </div>
                
            </div>
        </div>
        <?php endif;?>
	</div>
	</div>
	
</div>